package com.bwie.controller;

import com.baomidou.mybatisplus.annotation.TableField;
import com.bwie.service.OrderService;
import com.bwie.utils.R;
import com.bwie.vo.PageVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Title:
 * @BelongProjecet month0617
 * @BelongPackage com.bwie.mapper.controller
 * @Description:
 * @Copyright 研发一部
 * @Author: Mr.yan
 * @Date: 2024/6/17 11:12
 * @Version V1.0
 */
@RestController
@RequestMapping(value = "/order/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    /**
     * @Description: //创建索引
     * @Auther: yanxingru
     * @Date: 2024/6/17 12:37
     * @param:
     * @return com.bwie.utils.R
     */
    @PostMapping("/createIndex")
    public R createIndex(){
        return orderService.createIndex();
    }

    /**
     * @Description: //es列表，分页，高亮，查询，区间查询，模糊查询，排序
     * @Auther: yanxingru
     * @Date: 2024/6/17 11:57
     * @param:
     * @param pageVo
     * @return com.bwie.utils.R
     */
    @PostMapping("/esOrderList")
    public R esOrderList(
            @RequestBody PageVo pageVo
            ){
        return orderService.esOrderList(pageVo);
    }

    /**
     * @Description: //通过feign查找要货方信息
     * @Auther: yanxingru
     * @Date: 2024/6/17 12:58
     * @param:
     * @return com.bwie.utils.R
     */
    @PostMapping("/enquiryFeign")
    public R enquiryFeign(){
        return orderService.enquiryFeign();
    }

    /**
     * @Description: //通过feign查找发货方信息
     * @Auther: yanxingru
     * @Date: 2024/6/17 12:58
     * @param:
     * @return com.bwie.utils.R
     */
    @PostMapping("/deliverFeign")
    public R deliverFeign(){
        return orderService.deliverFeign();
    }
    @PostMapping("/updateStatus/{id}")
    public R updateStatus(
            @PathVariable Integer id
    ){
        return orderService.updateStatus(id);
    }
    @PostMapping("/findById/{id}")
    public R findById(
            @PathVariable Integer id
    ){
        return orderService.findById(id);
    }

}
